package com.heima.movement.controller;


import com.heima.models.common.Result;
import com.heima.movement.service.LikesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 黑马程序员
 * @since 2023-07-04
 */
@RestController
@RequestMapping("/like")
public class LikesController {

    @Autowired
    private LikesService likesService;

    @PostMapping("/movement")
    public Result likeMovement(@RequestParam String targetId) {
        return likesService.like(targetId, 1);
    }

    @PostMapping("/comment")
    public Result likeComment(@RequestParam String targetId) {
        return likesService.like(targetId, 2);
    }

}

